import Vue from 'vue'
import Router from 'vue-router'
import Recommend from '@/components/recommend/recommend'
import Disc from '@/components/disc/disc'
import Singers from '@/components/singers/singers'
import Rank from '@/components/rank/rank'
import Search from '@/components/search/search'
import SingerDetail from '@/components/singer-detail/singer-detail'
import RankDetail from '@/components/rank-detail/rank-detail'

Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: '/recommend'
  },
  {
    path: '/recommend',
    component: Recommend,
    children: [
      {
        path: ':id',
        component: Disc
      }
    ]
  },
  {
    path: '/singers',
    component: Singers,
    children: [
      {
        path: ':id',
        component: SingerDetail
      }
    ]
  },
  {
    path: '/rank',
    component: Rank,
    children: [
      {
        path: ':id',
        component: RankDetail
      }
    ]
  },
  {
    path: '/search',
    component: Search
  }
]

export default new Router({
  mode: 'history',
  routes
})
